<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>this复习</title>
</head>
<body>
<script type="text/javascript">
    function foo(b){
        this.a = b
    }
    var obj1 = {};
    var bar = foo.bind(obj1);
    bar(2);

    console.log(obj1.a);
    var baz = new bar(3);
    console.log(obj1.a);

    console.log(baz.a);
</script>
</body>
</html>